<div ng-controller="StoreCtrl" ng-init="pubcodeAction()">
    <ul class="sui-breadcrumb">
        <li><a href="#/store/list">{{'store'|translate}}</a></li>
        <li><a href="#/store/config?store_id={{store.store_id}}">{{store.name}}</a></li>
        <li>{{currentWxapp.nick_name}}</li>
        <!-- <li class="active">
            发布代码
        </li> -->
        <li class="active" ng-if="currentWxapp.app_id!='wx16d693ae1a3b83b0'&&currentWxapp.app_id!='wxecb076c64291682c'">
            选择版本:
            <wxapp-edition ng-model="wp" dft="1" obj="1"></wxapp-edition>

            <tab-bar-setting class="sui-btn btn-success" ng-show="wp" ng-model="windowConfig" list="wp"
                callback="upload(wp)" title="上传"></tab-bar-setting>
        </li>
        <span class="sui-form sui-form pull-right">
            <button class="sui-btn btn-danger" ng-click="codeSubmit(list)">提交审核</button>
            <button class="sui-btn btn-primary" ng-click="testQrCode()">{{'体验'|translate}}</button>
            <jump-app-list class="sui-btn btn-success" ng-model="wxappid" title="跳转" callback="
            currentAuthrizeApp()"></jump-app-list>
            <button class="sui-btn btn-success" ng-click="publish()">发布</button>
            <button class="sui-btn btn-danger" ng-click="withdrawAndRegresses('2','确认版本回退吗？')">回退版本</button>
            <automatic-executions ng-model="upgrade" appid="wxappid" keyname="CONFIG-UPGRADE" title="自动升级">
            </automatic-executions>
            <automatic-executions ng-show="upgrade == 2" ng-model="release" appid="wxappid" keyname="CONFIG-RELEASE"
                title="自动发布"></automatic-executions>
        </span>
    </ul>

    <div ng-if="CurrentAuditStatus.status=='1'" class="sui-msg msg-large msg-block msg-error">
        <div class="msg-con">审核失败：{{CurrentAuditStatus.reason}}</div>
        <s class="msg-icon"></s>
    </div>

    <div ng-if="CurrentAuditStatus.status=='0'" class="sui-msg msg-large msg-block msg-success">
        <div class="msg-con">
            审核成功！
            <button ng-if="CurrentAuditStatus.nocurrent" ng-click="publish()">发布</button>
        </div>
        <s class="msg-icon"></s>
    </div>
    <div ng-if="CurrentAuditStatus.status=='2'" class="sui-msg msg-large msg-block msg-notice">
        <div class="msg-con">
            审核中！
            <button class="sui-btn btn-danger"
                ng-click="withdrawAndRegresses('1','一天只能撤回一次，一个月只能撤回10次！确认撤回吗？')">撤回审核</button>

        </div>
        <s class="msg-icon"></s>
    </div>



    <table class="sui-table table-bordered">
        <thead>
            <tr>
                <th>{{'ID'|translate}}</th>
                <!-- <th>{{'小程序类型'|translate}}</th> -->
                <th>{{'发布模板ID'|translate}}</th>
                <th>{{'status'|translate}}</th>
                <th>{{'版本'|translate}}</th>
                <th>{{'描述'|translate}}</th>
                <th>{{'上传时间'|translate}}</th>
                <th>{{'上传'|translate}}</th>
                <th>{{'审核'|translate}}</th>
                <th>{{'提交审核时间'|translate}}</th>
                <th>{{'发布'|translate}}</th>
                <th>{{'发布时间'|translate}}</th>
                <th>{{'可见'|translate}}</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="list in wxapps">
                <td>{{list.user_app_id}}</td>
                <!--  <td>
                    <wxapp-type ng-model="list.app_id" stype="1"></wxapp-type>
                </td> -->
                <td>
                    {{list.template_id}}
                </td>
                <td>
                    <!-- <wxapp-statu ng-model="list.statu" stype="1"></wxapp-statu> -->
                    <span ng-if="list.template_id==storeCurrentCodeStatus.template_id"
                        class="sui-label label-warning">已上传(当前版本)</span>
                    <span
                        ng-if="list.template_id==storeCurrentCodeStatus.submit_template_id && storeCurrentCodeStatus.auditid"
                        class="sui-label label-warning">已提交审核</span> {{list.subaduit_id}}
                </td>
                <td>{{list.version}}</td>
                <td>{{list.description}}</td>
                <td>
                    <span ng-if="list.upload_time != '0001-01-01 08:00:00' ">
                        {{list.upload_time}}
                    </span>
                </td>
                <td>
                    <tab-bar-setting class="sui-btn btn-success"
                        ng-if="list.template_id!=storeCurrentCodeStatus.template_id" ng-model="windowConfig" list="list"
                        callback="upload(list)" title="上传"></tab-bar-setting>
                    <!-- <button class="sui-btn btn-success" ng-click="upload(list)" ng-if="list.template_id!=storeCurrentCodeStatus.template_id">{{'上传'|translate}}</button> -->
                    <!-- <button class="sui-btn btn-primary" ng-click="testQrCode()"
                        ng-if="list.template_id==storeCurrentCodeStatus.template_id">{{'体验二维码'|translate}}</button> -->
                    <tab-bar-setting class="sui-btn btn-success"
                        ng-if="list.template_id==storeCurrentCodeStatus.template_id" ng-model="windowConfig" list="list"
                        callback="upload(list)" title="重新上传"></tab-bar-setting>
                    <!-- <button class="sui-btn btn-success" ng-click="upload(list)" ng-if="list.template_id==storeCurrentCodeStatus.template_id">{{'重新上传'|translate}}</button> -->
                    <!-- <button class="sui-btn btn-primary" ng-if="list.template_id==storeCurrentCodeStatus.template_id" ng-click="domainUpdate()">开通接口</button> -->
                </td>
                <td>
                    <div ng-if="storeCurrentCodeStatus.submit_template_id==list.template_id">
                        <wxapp-code-statu ng-model="storeCurrentCodeStatus.auditstatus" stype="1"></wxapp-code-statu>
                    </div>
                    <div>
                        <!-- <button class="sui-btn btn-primary" ng-if="list.template_id==storeCurrentCodeStatus.template_id && !(storeCurrentCodeStatus.auditstatus==2)" ng-click="codeSubmit(list)">提交审核</button> -->
                        <!-- <button class="sui-btn btn-primary" ng-if="list.template_id==storeCurrentCodeStatus.template_id"
                            ng-click="codeSubmit(list)">提交审核</button> -->
                    </div>
                </td>
                <td>
                    <span ng-if="list.subaduit_time != '0001-01-01 08:00:00' ">
                        {{list.subaduit_time}}
                    </span>
                </td>
                <td>
                    <p ng-if="storeCurrentCodeStatus.submit_template_id==list.template_id">
                        <button
                            ng-if="storeCurrentCodeStatus.auditstatus==='0' && !storeCurrentCodeStatus.publishstatus"
                            ng-click="publish(list)">发布</button>
                        <span ng-if="storeCurrentCodeStatus.publishstatus===1">已发布</span>
                    </p>
                </td>
                <td>
                    <span ng-if="list.publish_time != '0001-01-01 08:00:00' ">
                        {{list.publish_time}}
                    </span>

                </td>
                <td>
                    <p ng-if="storeCurrentCodeStatus.submit_template_id==list.template_id">
                        <button
                            ng-if="storeCurrentCodeStatus.publishstatus==1 && storeCurrentCodeStatus.visiblestatus=='close'"
                            ng-click="visible('open')">显示</button>
                        <button
                            ng-if="storeCurrentCodeStatus.publishstatus==1 && storeCurrentCodeStatus.visiblestatus!=='close'"
                            ng-click="visible('close')">隐藏</button>
                    </p>
                </td>
            </tr>
        </tbody>
    </table>
</div>